Skip to content

Don't leak the global verbose flag into the test runner's ARGV#747

Merged
hsbt merged 2 commits into
masterfrom
claude/confident-villani-59a7bb
Jun 16, 2026
Merged

Don't leak the global verbose flag into the test runner's ARGV#747
hsbt merged 2 commits into
masterfrom
claude/confident-villani-59a7bb

Conversation

@hsbt

@hsbt hsbt commented Jun 16, 2026

Copy link
Copy Markdown
Member

--trace and -n set the global verbose flag, which since 13.4.2 caused TestTask to append -v to TESTOPTS. The :rake loader passes that -v on to the test process ARGV, breaking apps that inspect ARGV at load time (e.g. Sinatra) under rake test --trace.

The task block now keeps echoing the command for the global flag but bases the -v injection only on the task's own @verbose, so t.verbose = true and TESTOPTS=-v are unchanged.

Fixes #732

hsbt and others added 2 commits June 16, 2026 16:02
The global verbose flag is also set by --trace and -n, so deriving the
test runner's -v from it leaked -v into the test process ARGV and broke
apps that inspect ARGV at load time. Keep echoing the command for the
global flag, but base the -v injection only on the task's own @verbose.

Fixes #732

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
It is a helper, not a test case, so keep it under private like the
other helpers in the test suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hsbt hsbt merged commit 1d13bc9 into master Jun 16, 2026
79 checks passed
@hsbt hsbt deleted the claude/confident-villani-59a7bb branch June 16, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latest version of Rake is causing my Sinatra unit tests to crash

1 participant